package zcjq.d901;

import java.util.*;

public class Topology {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        // 测试组数
        int T = Integer.parseInt(scanner.nextLine());
        for (int i = 0; i < T; i++) {
            Map<Integer, Set<Integer>> map = new HashMap<>();
            String[] strs = scanner.nextLine().split(" ");
            int N = Integer.parseInt(strs[0]); //节点数
            int M = Integer.parseInt(strs[1]);  // 边数
            for (int j = 0; j < M; j++) { //录入边的信息
                String[] params = scanner.nextLine().split(" ");
                int a = Integer.parseInt(params[0]);
                int b = Integer.parseInt(params[1]);
                if (!map.containsKey(a)) {
                    map.put(a, new HashSet<Integer>());
                }
                map.get(a).add(b);
            }
            String name = scanner.nextLine();
            int who = name.equals("Alice") ? 0 : 1;
            // 获取所有成功的次数
            Map<Integer, List<List<Integer>>> successMap = new HashMap<>();
            canSuccess(map, N, new ArrayList<>(), 1, who, successMap);
            //
            who = getSuccess(successMap);
            if (0 == who) {
                System.out.println("Alice");
            } else {
                System.out.println("Bob");
            }
        }

    }

    private static int getSuccess(Map<Integer, List<List<Integer>>> successMap) {
        System.out.println(successMap);
        List<List<Integer>> list0 = successMap.get(0);
        List<List<Integer>> list1 = successMap.get(1);
        if (list0.size() == 0 && list1.size() != 0) {
            return 1;
        } else if (list0.size() != 0 && list1.size() == 0) {
            return 0;
        }
        // 找0
        int max0 = list0.stream().mapToInt(list -> list.size()).max().getAsInt();
        int idx0 = 0;
        for (int j = 0; j < max0; j++) {
            for (int i = 1; i < list0.size(); i++) {
                if (list0.get(i - 1).get(idx0) == list0.get(i).get(idx0)) {
                    break;
                } else {
                    idx0++;
                    break;
                }
            }
        }


        // 找1
        int max1 = list1.stream().mapToInt(list -> list.size()).max().getAsInt();
        int idx1 = 0;
        for (int j = 0; j < max1; j++) {
            for (int i = 1; i < max1; i++, idx1++) {
                if (list1.get(i - 1).get(idx1) == list1.get(i).get(idx1)) {
                    continue;
                } else {
                    idx1++;
                    break;
                }
            }
        }


        if (idx0 < max0 && idx1 < max1) {
            if (idx0 < idx1) {
                return 0;
            } else {
                return 1;
            }
        } else if (idx0 < max0) {
            return 0;
        } else {
            return 1;
        }
    }


    private static void canSuccess(Map<Integer, Set<Integer>> map, int N, List<Integer> saved, int now, int who, Map<Integer, List<List<Integer>>> successMap) {
        saved.add(now);
        if (now == N) { //结束
            List<Integer> list = new ArrayList<>(saved);
            if (!successMap.containsKey(who)) {
                successMap.put(who, new ArrayList<>());
            }
            successMap.get(who).add(list);
        } else if (map.containsKey(now)) { //没结束
            for (int num : map.get(now)) {
                canSuccess(map, N, saved, num, (who + 1) % 2, successMap);
            }
        }
        saved.remove(saved.size() - 1);
    }

}
